package com.jurenzhao.partssystem.accessories.analysis.service;

import com.jurenzhao.partssystem.accessories.analysis.dao.Piece_InfoMapper;
import com.jurenzhao.partssystem.accessories.analysis.entity.Piece_Info;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Piece_InfoMapperSerevice {
    @Resource
    private Piece_InfoMapper piece_infoMapper;

    public List<Piece_Info> findAll(){
        return piece_infoMapper.findAll();
    }

     public boolean delete(Integer pieceId ){
        return piece_infoMapper.deleteByPrimaryKey(pieceId)>0;
     }

     public boolean save(Piece_Info   piece_info){
        return piece_infoMapper.insert(piece_info)>0;
     }
     public boolean update(Piece_Info piece_info){
        return piece_infoMapper.updateByPrimaryKeySelective(piece_info)>0;

     }


    public Piece_Info findById(int pieceId) {
        return piece_infoMapper.selectByPrimaryKey(pieceId);
    }
}
